#!/usr/bin/perl -w
use strict;
use warnings;

while (<>) {
	my @arr = split(';');
	my $province = '';
	foreach my $line (@arr) {
		if ($line =~ /new Province\("([\d\D]+)","[\d\D]+"\)/) {
			$province = $1;
		}
		elsif ($line =~ /new Board\([\d]+,"([\d\D]+)","([\d\D]+)"\)\)/) {
			my $s = "中国:$province:$1";
			my $city = $1;
			if (length($1) > 6) {
				if ($1 =~ /([\d\D]+)市/) {
					$city = $1;
				}
				elsif ($1 =~ /([\d\D]+)地区/) {
					$city = $1;
				}
				elsif ($1 =~ /([\d\D]+)盟/) {
					$city = $1;
				}
				elsif ($1 =~ /([\d\D]+)区/) {
					$city = $1 if (index($1, '林') == -1);
				}
				elsif ($1 =~ /([\d\D]+)县/) {
					$city = $1 if (index($1, '自治') == -1);
				}
			}
			print "$city	$s\n";
		}
	}
}
